package com.cokoyan.game.afts;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;

public class GraphsSprite {

	public static Bitmap loadBitmap(Drawable sprite) {
		int width = sprite.getIntrinsicWidth();
		int height = sprite.getIntrinsicHeight();
		Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
		Canvas canvas = new Canvas(bitmap);
		sprite.setBounds(0, 0, width, height);
		sprite.draw(canvas);
		return bitmap;
	}
	public static Bitmap loadSemiBitmap(Drawable sprite) {
		int width = sprite.getIntrinsicWidth();
		int height = sprite.getIntrinsicHeight();
		Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
		Canvas canvas = new Canvas(bitmap);
		sprite.setBounds(0, 0, width, height);
		sprite.draw(canvas);
		return bitmap;
	}
	public static Bitmap loadFastBitmap(Drawable sprite) {
		int width = sprite.getIntrinsicWidth();
		int height = sprite.getIntrinsicHeight();
		Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
		Canvas canvas = new Canvas(bitmap);
		sprite.setBounds(0, 0, width, height);
		sprite.draw(canvas);
		return bitmap;
	}
	
}
